import {
  post,// get
} from "utils/fetch";

// const processList = data => post("/flow-platform/process/list", data);
// 实例监控-列表查询
const processList = data => post("/flow-platform/monitor/processInstance/list", data);
// 任务监控-列表查询
const taskList = data => post("/flow-platform/monitor/task/list", data);
// const processHandle = data => post("/flow-platform/process/handle", data);
const processHandle = data => post(" /flow-platform/monitor/processInstance/doAction", data);
const TaskSkipList = data => post("/flow-platform/task/skip/list", data);
const TaskSkip = data => post("/flow-platform/task/skip", data);
// 转办
const BatchTurnTasks = data => post("/flow-platform/task/batchTurnTasks", data);


/**
 * 规则操作监控-列表查询
 * @param {
 *  "pageNum": 1,
	  "pageSize": 6
    "operator": [],  //操作人
    "timeStart":"2019-08-21 14:40:56",
    "timeEnd":"2019-08-21 14:58:56",
    "businessName": "", //业务
    "appName": "", //应用
    "modelName": "", //流程名称
    "modelId": "", //流程标识ID
}

 * @constructor
 */
const getRuleActionList = ({ pageNum, pageSize, operator, timeStart, timeEnd, busiId, appId, modelName, modelId, operatingTimeOrderBy, modelStatus }) => post(" /flow-platform/monitor/ruleAction/list", {
  pageNum,
  pageSize,
  operator,
  timeStart,
  timeEnd,
  busiId,
  appId,
  modelName,
  modelId,
  operatingTimeOrderBy,
  modelStatus,
});

const runningVariableList = data => post("/flow-platform/monitor/variable/running", data);

const historicVariableList = data => post("/flow-platform/monitor/variable/historic", data);

const updateVariable = data => post("/flow-platform/monitor/variable/running/update", data);

export default {
  processList,
  processHandle,
  taskList,
  TaskSkipList,
  TaskSkip,
  BatchTurnTasks,
  getRuleActionList,
  runningVariableList,
  historicVariableList,
  updateVariable,
};
